package com.charity.service.serviceImpl;

import com.charity.mapper.UserMapper;
import com.charity.model.CommonResponse;
import com.charity.model.bo.CharityAddDonationInputBO;
import com.charity.model.bo.CharityAddEntrydInputBO;
import com.charity.pojo.Entry;
import com.charity.pojo.User;
import com.charity.service.CharityService;
import com.charity.service.UserService;
import org.fisco.bcos.sdk.transaction.model.dto.TransactionResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    public static final String PubKey = com.charity.utils.IOUtil.readResourceAsString("conf/PubKey");
    public static final String PriKey = com.charity.utils.IOUtil.readResourceAsString("conf/PriKey");

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private CharityService charityService;

    private CommonResponse commonResponse = new CommonResponse();

    @Override
    public User user(String userName, String password) {
        return userMapper.user(userName, password);
    }

    @Override
    public Integer addUser(String userName, String password, String role, String realName, String sex, String idCard, String account, String phone, String email, String address, String difficultyType, String createDate) {
        return userMapper.addUser(userName, password, role, realName, sex, idCard, account, phone, email, address, difficultyType, createDate);
    }

    @Override
    public Long userId(String userName) {
        return userMapper.userId(userName);
    }

    @Override
    public User userById(Long id) {
        return userMapper.userById(id);
    }

    @Override
    public Integer updateUser(Long id, String userName, String password, String realName, String sex, String idCard, String account, String phone, String email, String address, String difficultyType) {
        return userMapper.updateUser(id, userName, password,realName, sex, idCard, account, phone, email, address, difficultyType);
    }

    @Override
    public Integer deleteUser(Long id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public List<User> userBySZ() {
        return userMapper.userBySZ();
    }

}
